routing mode.
Ifconfig-pool-persist ipp.txt
Define the relationship between the client and the virtual IP address. Especially when openvpn is restarted, the client connected again will still be assigned and the previous IP address will be disconnected.
Server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
Defines the IP address segment allocated to the client when openvpn uses the tap Bridge Mode.
network communication of the clientvpn, this can be selected, if commented out that is the local packet or from the local out, not forced to go VPN
Push "Dhcp-option DNS 8.8.8.8" #Specify the primary DNS used by the client
Push "Dhcp-option DNS 8.8.4.4" #Specify the standby DNS used by the client
Client-to-clien
different clients
# Make the script run automatically. For more information, see man.
; Learn-address./script
# This statement can be used if the client wants all traffic to be transmitted over the VPN
# It will automatically change the gateway of the client to a VPN server. we recommend that you disable it.
# Be careful when configuring DHCP settings on the server.
; Push "redirect-gateway"
# Use the DHCP function of OpenVPN to provide the specified
bypass-dhcp"# Specify a DNS server for the clientPush "dhcp-option DNS 210.5.153.250"Push "dhcp-option DNS 192.168.0.1"# Configure to allow access between clientsClient-to-client# Enable allow multiple clients to connect at the same time. if the Common Name of the CA used by the Client is repeated, or the Client uses the same CA and keys to connect to the VPN, y
Rotten mud: ubuntu 14.04 OpenVPN server, 14.04 openvpn
This article is written by Xiuyi Lin FengProviding friendship sponsorship, first launched in the dark world
The company branch needs to connect to the company's internal server, but the server only allows access to the company's internal network.
To solve this problem, we plan to use VPN. PPTP is the most widely used solution for VPN in the past, but
/server. conf/etc/openvpn
Then modify the configuration vi server. conf as follows:
Local 192.227.161.xx (with your own vps IP address)Port 1194Proto udpDev tunCa/etc/openvpn/ca. crtCert/etc/openvpn/server. crtKey/etc/openvpn/server. key # This file shocould be kept secretDh/etc/
10.8.0.0 255.255.255.0 Client-to-clientKeepAlive 10 120 Comp-lzo Persist-keyPersist-tunStatus/openvpn-2.0.5/easy-rsa/keys/openvpn-status.logVerb 4 Push "Dhcp-option DNS 10.8.0.1"Push "Dhcp-option DNS 70.88.98.10" # Name server address, how to obtain the following instructionsPush "Dhcp-option
= "netops@netops.com"
Export KEY_OU = "netops"
# Initializing Environment Variables
Source vars
# Generate the root certificate, Root key, server certificate, server key, Diffie-Hellman key, and ta. key Files.
./Clean-all
./Build-ca
./Build-key-server OpenVPN
./Build-dh
Openvpn -- genkey -- secret keys/ta. key
The generated Certificate file is under the keys directory of the current directory.
mode to listen to the default UDP port 1194. The Virtual Interface uses the tun0 device. See the configuration example openvpn-2.0.9/sample-config-files/server. conf in the openvpn source code directory)
[Root @ gw1 ~] # Vim/etc/openvpn/gw1_tun0.conf
Local 173.74.75.76 // specify the IP address of the listener service Port 1194 // enable the default
The first bottleneck of openvpn is that the Tun character device reads and writes frames at one link layer. The reason why the user-mode openvpn process must have the same link-MTU on both ends, it is because each time openvpn reads a complete Ethernet frame from the/dev/NET/TUN character device, there are not many, and the library interface: ssize_t read (int fd
/# vim/etc/openvpn/2.0/conf/server. confport 1194 proto udp dev tun ca/etc/openvpn/2.0/keys/ca. crtcert/etc/openvpn/2.0/keys/server. crtkey/etc/openvpn/2.0/keys/server. key # This file shoshould be kept secret dh/etc/openvpn/2.0/keys/login server 10.8.0.0 255.255.255.0push "
Official manual page.Server 10.8.0.0 255.255.255.0
# Specifies the file that is used to record the association relationship between the client and the virtual IP address.# when the OpenVPN is restarted, the reconnected client is assigned the same virtual IP address as the previous assignmentIfconfig-pool-persist Ipp.txt
# This directive is only for Ethernet bridging mode.# First, you must use the operating system bridge capability to bridge the Eth
, this directive will configure# All clients to redirect their default# Network gateway through the VPN, causing# All IP traffic such as web browsing and# And DNS lookups to go through the VPN# (The OpenVPN server machine may need to NAT# Or bridge the TUN/TAP interface to the internet
# In order for this to work properly ).Push "redirect-gateway def1 bypass-dhcp"
# Certain Windows-specific network settings
such as winscp.
6. create a server configuration fileDecompress the source code and copy the standard configuration file in the directory.Mkdir/etc/openvpn/easy-rsa/2.0/conf/Cp/tmp/openvpn-2.2.2/sample-config-files/server. conf/etc/openvpn/easy-rsa/2.0/conf/Edit the configuration file:Vim/etc/openvpn/easy-rsa/2.0/conf
VPN subnet# For OpenVPN to draw client addresses from.# The server will take 10.8.0.1 for itself,# The rest will be made available to clients.# Each client will be able to reach the server# On 10.8.0.1. Comment this line out if you are# Ethernet bridging. See the man page for more info.Server 10.9.0.0 255.255.255.0 # IP address segment on the virtual network card
# Maintain a record of client # Associations in this file. If
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.